<?php
/**
 * @copyright SYS Company
 * @version : 1.0
 * @name : CRUD Class
 * @todo:  Lớp  mở rộng của CModule. Thao tác danh sách, sửa, xóa cơ sở.
*/
class VictAdminMenu extends Menu
{
	function draw()
	{		
		//echo $_SERVER['SERVER_ADDR'].'<br>';
		if(user()->is_admin())
		{
			$menu = 'portals/'.portal()->id.'/menus/vict.super_administrator.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['ViskyAdministrator']))
		{
			$menu = 'portals/'.portal()->id.'/menus/visky.administrator.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['GameAdmin']))
		{
			$menu = 'portals/'.portal()->id.'/menus/game_admin.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['TransportAdministrator']))
		{
			$menu = 'portals/'.portal()->id.'/menus/transporter.administrator.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['EstoreAdministrator']))
		{
			$menu = 'portals/'.portal()->id.'/menus/supplier.administrator.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['EstoreManager']))
		{
			$menu = 'portals/'.portal()->id.'/menus/supplier.manager.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['EstoreEmployee']))
		{
			$menu = 'portals/'.portal()->id.'/menus/supplier.user.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['ProviderWarehouseAdmin']))
		{
			$menu = 'portals/'.portal()->id.'/menus/supplier.user.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['TransportEmployee']))
		{
			$menu = 'portals/'.portal()->id.'/menus/transporter.user.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['Salesman']))
		{
			$menu = 'portals/'.portal()->id.'/menus/salesman.menu.xml';
		}
		elseif(isset(user()->privileges[portal()->id]['ShopAdministrators']))
		{
			$menu = 'portals/'.portal()->id.'/menus/estore.shop.menu.xml';
		}
		else
		{			return;
		}	
		$this->data['settings']['menu'] = $menu;
		CForm('packages/system/packages/layout/modules/Menu/layout.tpl')->parse(array(
			'ul_li' => $this->make_ul_li(),
			'portals' => $this->get_portals()
		));
 	}
}
?>